﻿'use strict';

/* httpPlus Service */
app.service('wemaskPlus', ['$window', '$q', function ($window, $q) {
    var tmpMaskPlus =
     '<div id="loadingToast" style="display: none;">' +
     '<div class="weui-mask_transparent" ></div>' +
     '<div class="weui-toast">' +
     '<i class="weui-loading weui-icon_toast"></i>' +
     '<p class="weui-toast__content">数据加载中</p>' +
     '</div>' +
     '</div>';


    var divMaskPlus = angular.element('div#loadingToast');
    if (divMaskPlus.length == 0)
        angular.element('body').append(tmpMaskPlus);
        divMaskPlus = angular.element('div#loadingToast');
    var txtMaskPlusText = angular.element('p.weui-toast__content');
    var defaultMaskPlusText = '数据加载中';

    var timeoutMaskPlus = undefined;

    this.showLoading = function (_msg) {
        divMaskPlus.show();
        txtMaskPlusText.text(_msg || defaultMaskPlusText);
 
    };

    this.hideLoading = function (_msg) {
        divMaskPlus.hide();
    }
}]);